﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using Serilog;
using Microsoft.Extensions.Configuration;
using CoworkspaceAdmin.Models;

namespace CoworkspaceAdmin.Controller
{

    interface ICompanyManager
    {
        /* use tag to do the filter, for example: tag = "gov" */
        Company GetCompany(string id, string tag="");
        List<Company> GetCompanies(string tag = "");

        bool CreateCompany(Company c);
        bool UpdateCompany(Company c);
        bool RemoveCompany(string id);
    }

    public class CompanyManager : ICompanyManager
    {
        private Dictionary<string, Company> companies = new Dictionary<string, Company>();

        void SyncCompaniesFromDB()
        {

        }

        public Company GetCompany(string id, string tag="")
        {
            // todo
            return null;
        }

        public List<Company> GetCompanies(string tag="")
        {
            // todo
            return null;
        }

        public bool UpdateCompany(Company c)
        {
            // todo
            return false;
        }

        public bool CreateCompany(Company c)
        {
            // todo
            return true;
        }

        public bool IsCompanyExist(string name) {
            return false;
        }

        public bool RemoveCompany(string id)
        {
            // todo
            Log.Information("test RemoveCompany, {0}", id);
            return false;
        }
        

    }
}
